package com.donn.securitycontrolplatform.expection;

import com.donn.securitycontrolplatform.emum.RESULT_CODE;
import lombok.Data;

/**
 * 
 * @description 自定义异常信息
 * @author xianzw
 * @time 2019年2月27日下午4:20:06
 */
@Data
public class BusinessRuntimeException extends RuntimeException{

	private static final long serialVersionUID = 1L;

	private Integer exceptionCode;//异常码
	
	private String exceptionMessage;//异常信息
	
	
	public BusinessRuntimeException(Integer exceptionCode) {
		super();
		this.exceptionCode = exceptionCode;
	}


	
	public BusinessRuntimeException(Integer exceptionCode,String exceptionMessage){
		super();
		this.exceptionCode = exceptionCode;
		this.exceptionMessage = exceptionMessage;
	}

	public BusinessRuntimeException(RESULT_CODE resultCode){
		super();
		this.exceptionCode = resultCode.getCode();
		this.exceptionMessage = resultCode.getMessage();
	}


	//根据异常码获取异常信息
	@Override
	public String getMessage() {
    	return "手动写死的错误信息 记得更改";
	}
	
}
